<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<script type="text/javascript">
	function ciTypeOnchange() {

		var val = $("#ciType").val();
		if (val == "指定类型") {
			$("#ciCategoryTr").show();
		} else {
			$("#ciCategoryTr").hide();
		}

	}

	function incidentTypeOnchange() {
		var val = $("#incidentType").val();
		if (val == "指定类型") {
			$("#incidentCategoryTr").show();
		} else {
			$("#incidentCategoryTr").hide();
		}
	}
</script>

<form:form commandName="model" cssClass="validate"
	id="autoTriggerRuleForm" action="problem/autoTriggerRule/save">
	<form:hidden path="id" />
	<div class="header">
		<h2>范围设定</h2>
	</div>
	<table class=" form-table">
		<tbody>
			<tr>
				<td class="td1">资产类型范围：</td>
				<td class="td2"><select id="ciType" name="ciType"
					onchange="ciTypeOnchange()">
						<option value="不指定">不指定</option>
						<option value="同一资产">同一资产</option>
						<option value="同一类型">同一类型</option>
						<option value="指定类型">指定类型</option>
				</select>
				</td>
			</tr>
			<tr id="ciCategoryTr" style="display:none">
				<td class="td1">资产类型：</td>
				<td class="td2"><form:hidden path="ciCategory" /> <isperp:treeSelector
						url="configuration/category/getTree" id="ciCategorySelector"
						name="ciCategoryName" displayValue="${model.ciCategoryName }"
						valueControlId="ciCategory"></isperp:treeSelector></td>
			</tr>
			<tr>
				<td class="td1">故障类型范围：</td>
				<td class="td2"><select id="incidentType" name="incidentType"
					onchange="incidentTypeOnchange()">
						<option value="不指定">不指定</option>
						<option value="同一类型">同一类型</option>
						<option value="指定类型">指定类型</option>
				</select>
				</td>
			</tr>
			<tr id="incidentCategoryTr" style="display:none">
				<td class="td1">故障类型：</td>
				<td class="td2"><form:hidden path="incidentCategory" /> <isperp:treeSelector
						url="incident/category/getTree" id="incidentCategorySelector"
						name="incidentCategoryName"
						displayValue="${model.incidentCategoryName }"
						valueControlId="incidentCategory"></isperp:treeSelector></td>
			</tr>
			<tr>
				<td class="td1">故障级别：</td>
				<td class="td2"><isperp:dictSelector id="incidentPriority"
						name="incidentPriority" typeCode="INCIDENT_PRIORITY"></isperp:dictSelector>
				</td>
			</tr>
			<tr>
				<td class="td1">故障满意度：</td>
				<td class="td2"><isperp:dictSelector id="incidentSatisfication"
						name="incidentPriority" typeCode="INCIDENT_SATISFICATION"></isperp:dictSelector>
				</td>
			</tr>

		</tbody>
	</table>
	<div class="header">
		<h2>频率设定</h2>
	</div>
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">时间范围：</td>
				<td class="td2"><form:input path="timeDistance"
						cssClass="number required" />（小时，0表示无时间限制）</td>
			</tr>
			<tr>
				<td class="td1">次数：</td>
				<td class="td2"><form:input path="occurTimes"
						cssClass="number required" />
				</td>
			</tr>
			<tr>
				<td class="td1">内容模板：</td>
				<td class="td2"><form:textarea path="contentsTemplate"
						cssClass="required" /><br>（支持参数：资产类型 {ciCategoryName
					}，故障类型{incidentCategoryName }，故障级别{incidentPriority}）</td>
			</tr>
		</tbody>
	</table>
</form:form>
<isperp:buttonList>
	<button class="submit nui-mainbtn" onclick="isperp.submitForm();">保存</button>
</isperp:buttonList>


